package com.rpc.rpcservercontainer;

import org.apache.log4j.Logger;

/**
 * Handles uncaught exceptions from a thread by logging them.
 */
public class RpcServerUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
    private final static Logger log = Logger.getLogger(RpcServerUncaughtExceptionHandler.class);
    
    
    /**
     * Logs the uncaught exception in <code>thread</code>.
     * 
     * @param thread The thread the exception was thrown from.
     * @param thrwbl The exception thrown.
     */
    public void uncaughtException(Thread thread, Throwable thrwbl) {
        log.error("Uncaught exception from RPC Server thread: " + thread.getName() + ".", thrwbl);
    }
    
}
